<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>computed</title>
</head>

<body>
    <div id="app">
        <div id="app">
            <p>原始字符串： {{message }}</p>
            <p>计算后的反转字符串： {{reversedMessage}}</p>
            <p>计算后的反转字符串222： {{reversedMessage}}</p>
        </div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.prod.js"></script>
    <script>
        const vm = Vue.createApp({
            data() {
                return {
                    message: 'Hellol, welcome to Vue!'
                }
            },
            // 计算属性
            computed: {
                //计算属性的getter
                reversedMessage() {
                    return this.message.split('').reverse().join('');
                }
            }

        }).mount(' #app');
    </script>
</body>

</html>